package com.huawei.hms.framework.network.restclient.hianalytics;

import com.huawei.hms.framework.common.Logger;
import com.huawei.hms.framework.network.restclient.hwhttp.Response;
import java.net.MalformedURLException;
import java.net.URL;

public abstract class BaseRequestFinishedInfo extends RequestFinishedInfo {
    private static final String TAG = "BaseRequestFinishedInfo";
    private Exception exception;
    private String host;
    private Response response;
    private String url;

    public void setUrl(String str) {
        this.url = str;
        try {
            this.host = new URL(str).getHost();
        } catch (MalformedURLException e) {
            Logger.i(TAG, "fail to get hostname from url");
        }
    }

    public void setException(Exception exception) {
        this.exception = exception;
    }

    public void setResponse(Response response) {
        this.response = response;
    }

    public String getUrl() {
        return this.url;
    }

    public String getHost() {
        return this.host;
    }

    public Exception getException() {
        return this.exception;
    }

    public Response getResponse() {
        return this.response;
    }
}
